﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using Common;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //Basic.Business.AutoNumberAdmin.AddAutoNumber(10000001, 10000001, "Educational_School");
            ISession session = NHibernateHelper.OpenSession();
            Console.Write(Basic.Model.EntityManager.AdminManager.GetAllByCondition(session,"", null,-1, 0,100).Count);
            //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            //ISession session = null;
            //ITransaction trans = null;
            //try
            //{
            //    session = NHibernateHelper.OpenSession();
            //    trans = session.BeginTransaction();
            //    for (int i = 2000000; i < 3000000; i++)
            //    {
            //        Basic.Model.Entity.Collision collision = new Basic.Model.Entity.Collision();
            //        collision.itemKey = i.ToString();
            //        Basic.Model.EntityManager.CollisionManager.AddItem(session, collision);
            //    }
            //    stopwatch.Start();
            //    trans.Commit();
            //    stopwatch.Stop();
            //}
            //catch
            //{
            //    if (trans != null)
            //        trans.Rollback();
            //    throw;
            //}
            //finally
            //{
            //    if (session != null)
            //        session.Close();
            //}
            //Console.Write("任务 2 用时：" + stopwatch.ElapsedTicks.ToString());
            //Console.Write(Educational.Business.SchoolAdmin.GetsSchool("中学", "", 0, 20).Count);
        }
    }
}
